/** \file qwwmainwindow.cpp
 * \brief QWordWizard main window
 */

#ifndef __QWWMAINWINDOW_H
#define __QWWMAINWINDOW_H

#include <memory>
#include <QTextEdit>
#include <QTimer>
#include "qwwmenu.h"

using namespace std;

/** class QWWMainWindow
 * \brief Word Wizard main window
 */
class QWWMainWindow : public QTextEdit
{
    Q_OBJECT

    public:
        /**
         * Constructor
         * \param parent Parent widget
         * \param f Window flags
         */
        QWWMainWindow(QWidget *parent = 0, Qt::WindowFlags f = 0);

        /**
         * Destructor
         */
        ~QWWMainWindow();

    private:
        /**
         * Read setting
         */
        void ReadSettings();

        /**
         * Write settings
         */
        void WriteSettings();

    private slots:
        /**
         * About
         */
        void ShowAbout();

        /**
         * Settings
         */
        void ShowSettings();

        /**
         * Show/Hide
         * \param reason Reason
         */
        void ShowHide(QSystemTrayIcon::ActivationReason reason = QSystemTrayIcon::Trigger);

        /**
         * Move/Freeze
         */
        void MoveFreeze();

        /**
         * Update label
         */
        void UpdateLabel();

    private:
        auto_ptr<QWWMenu> mp_menu;              /**< Menu */
        auto_ptr<QTimer> mp_timer;              /**< Timer */
        int m_interval;                         /**< Timer interval */
};

#endif
